#ifndef __ILIB_CORE_LISTEN_CONNECTION_H_20120323__
#define __ILIB_CORE_LISTEN_CONNECTION_H_20120323__

#include "iConnection.h"
#include "iTPListener.h"
class iListenConnection : public iConnection
						, public iTPListener
{
public:
	iListenConnection(const char* address, iAllocator* alloc);

public:
	virtual bool listen(iTPListener::iSink* sink);
	virtual void close();

protected:
	// override iConnection
	virtual void on_connect_indication(iClientSocket* cs);

	// override iMsgProcessor
	virtual int on_message(iMsgID msg, void* param);

protected:
    iTPListener::iSink* m_sink;
	soctx*				m_soctx;
};

class iPBNListenConnection : public iListenConnection
{
public:
	iPBNListenConnection(const char* address, iAllocator* alloc);

private:
	//override iConnection
	virtual void on_connect_indication(iClientSocket* cs);

	// override iMsgProcessor
	virtual int on_message(iMsgID msg, void* param);
};
#endif  //__ILIB_CORE_LISTEN_CONNECTION_H_20120323__
